<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html><!-- InstanceBegin template="/Templates/Function Info.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
<!-- InstanceBeginEditable name="doctitle" -->
<title>WinXAddButton</title>
<!-- InstanceEndEditable -->
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<!-- InstanceBeginEditable name="head" --><!-- InstanceEndEditable -->
<style type="text/css">
<!--
.style3 {font-size: medium}
-->
</style>

<link href="../../WinXStyles.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style1 {
	font-size: x-large;
	font-family: Verdana, Arial, Helvetica, sans-serif;
}
.style2 {
	font-size: large;
	font-family: Verdana, Arial, Helvetica, sans-serif;
}
-->
</style>
</head>

<body>
<h1 class="style1"><img src="../../WinX48.png" width="48" height="48" align="absmiddle"> <!-- InstanceBeginEditable name="title" -->WinXAddButton<!-- InstanceEndEditable --></h1>
<hr>

<!-- InstanceBeginEditable name="Prototype" -->
<p>hButton = WinXAddButton (parent, STRING title, hImage, id) </p>
<!-- InstanceEndEditable --><!-- InstanceBeginEditable name="Description" -->
<p>Creates a new button and adds it to the window.</p>
<!-- InstanceEndEditable -->
<table width="80%" border="1" cellpadding="0" cellspacing="0">
  <tr bgcolor="#CCCCCC">
    <th width="24%"><span class="style3">Parameter</span></th>
    <th width="76%"><span class="style3">Description</span></th>
  </tr>
  <!-- InstanceBeginRepeat name="Parameter Table" --><!-- InstanceBeginRepeatEntry -->
  <tr bgcolor="#E8E8E8">
    <td><!-- InstanceBeginEditable name="Parameter" -->parent<!-- InstanceEndEditable --></td>
    <td><!-- InstanceBeginEditable name="Description" -->&nbsp;The parent window for the button <!-- InstanceEndEditable --></td>
  </tr>
  <!-- InstanceEndRepeatEntry --><!-- InstanceBeginRepeatEntry -->
  <tr bgcolor="#E8E8E8">
    <td><!-- InstanceBeginEditable name="Parameter" -->STRING title<!-- InstanceEndEditable --></td>
    <td><!-- InstanceBeginEditable name="Description" -->The text to appear in the button. If this is an image button, this parameter is either &quot;bitmap&quot; or &quot;icon&quot;. See the remarks for more information <!-- InstanceEndEditable --></td>
  </tr>
  <!-- InstanceEndRepeatEntry --><!-- InstanceBeginRepeatEntry -->
  <tr bgcolor="#E8E8E8">
    <td><!-- InstanceBeginEditable name="Parameter" -->hImage<!-- InstanceEndEditable --></td>
    <td><!-- InstanceBeginEditable name="Description" -->The handle to the image if this is an image button, otherwise 0 <!-- InstanceEndEditable --></td>
  </tr>
  <!-- InstanceEndRepeatEntry --><!-- InstanceBeginRepeatEntry -->
  <tr bgcolor="#E8E8E8">
    <td><!-- InstanceBeginEditable name="Parameter" -->id<!-- InstanceEndEditable --></td>
    <td><!-- InstanceBeginEditable name="Description" -->A unique  constant to identify this button <!-- InstanceEndEditable --></td>
  </tr>
  <!-- InstanceEndRepeatEntry --><!-- InstanceEndRepeat -->
</table>
<h3>Returns</h3>
<!-- InstanceBeginEditable name="Return Info" -->
<p>The handle to the button or 0 on fail </p>
<!-- InstanceEndEditable -->
<h3>Remarks</h3>
<!-- InstanceBeginEditable name="Remarks" -->
<p>There are two kinds of buttons, buttons with text labels and buttons with images. To create a button with a text label, set the title parameter to the label and set the hImage parameter to 0. To create an image button, you need a handle to a bitmap or a handle to an icon. Set the hImage parameter to the handle and the title parameter to &quot;bitmap&quot; for a bitmap handle or &quot;icon&quot; for an icon handle.</p>
<p>The size and position of the button is set using either a custom control sizer function (<a href="../Callbacks.htm/controlSizer.htm">controlSizer</a> callback) or the auto sizer. To use the auto sizer, use the <a href="../Auto%20Sizer.htm/WinXAutoSizer_SetInfo.htm">WinXAutoSizer_SetInfo</a> function. </p>
<!-- InstanceEndEditable -->
<h3>Examples</h3>
<table width="80%"  border="0">
  <tr>
    <td bgcolor="#C6C6FF"><!-- InstanceBeginEditable name="Example Code" --><span class="codeStyle">'define constants for the buttons <br>
      $$IDBUTTON1 = 100 <br>
      $$IDBUTTON2
      = 101 <br>
      <br>
      'make a button with text <br>
  hButton1 = WinXAddButton (#hMain, &quot;Click me&quot;, 0, $$IDBUTTON1)<br>
  <br>
  'make a button using an icon loaded from the resource file<br>
  hImage = LoadIconA (GetModuleHandleA (0), &amp;&quot;mainIcon&quot;)<br>
  hButton2 = 
    WinXAddButton (#hMain, &quot;icon&quot;, hImage, $$IDBUTTON2)</span><!-- InstanceEndEditable --></td>
  </tr>
</table>

<h2 class="style2">Related Links</h2>
<!-- InstanceBeginEditable name="Related Links" -->
<p><a href="../Auto%20Sizer.htm/WinXAutoSizer_SetInfo.htm">WinXAutoSizer_SetInfo</a><br>
<a href="../Callbacks.htm/controlSizer.htm">controlSizer</a></p>
<!-- InstanceEndEditable -->
</body>
<!-- InstanceEnd --></html>
